From 2ca9b0cb1093d2556ec5769a6ffd47e1a621e6fb Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=98yvind=20Kol=C3=A5s?= Date: Tue, 11 Sep 2018 17:06:14 +0200 Subject: [PATCH] docs: add section about premultiplied alpha --- docs/index-static.html.in | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/docs/index-static.html.in b/docs/index-static.html.in index b0a04bd..be463ad 100644 --- a/docs/index-static.html.in +++ b/docs/index-static.html.in @@ -265,7 +265,7 @@ lab_buffer = malloc (pixel_count * 3 * sizeof (float)); non-linear variants of the data.

-

There is also a babl API call for creating a format for a specific space. +

babl has API for creating a format for a specific space: babl_format_with_space("R'G'B' u16", babl_space ("Rec2020")) creates a 16 bit integer format for the Rec2020 color space. Babl knows internally about "sRGB", "Rec2020", "Adobe", "Apple" and "ProPhoto" spaces, as they are @@ -279,12 +279,10 @@ lab_buffer = malloc (pixel_count * 3 * sizeof (float));

The conversions babl does with ICC profiles are according to what is known as the relative-colorimetric intent, monitor profiles containing both the - matrices used by babl and 3d CLUTs (color look up tables) most often also do + matrices used by babl and 3d CLUTs (color look up tables) sometimes also do relative-colorimetric transfer for the "perceptual" intent CLUTs, but with - a more flexible and possibly higher accuracy conversions. If babl adds support - for loading and using CLUTs it will be thus the perceptual - intent will by babl be considered a different albeit more accurate - relative-colorimetric RGB space.

+ a more flexible and possibly higher accuracy conversions.

+

Vocabulary

@@ -357,6 +355,24 @@ lab_buffer = malloc (pixel_count * 3 * sizeof (float)); --> + +

Pre-multiplied alpha

+ +

babl stores color information in transparent pre-multiplied or associated +alpha pixels in floating point formats. With floating point pixel formats +standard way of handling alpha maintains color information very near fully +transparent pixels - by introducing a limit: BABL_ALPHA_FLOOR which is +1/65536.0, and treating all alphas beteen zero and this value as this value we +maintain color information while the discrepancy in behavior gets concealed by +quantization in 16bit and 8bit formats. +

+

For images that already are in a premultiplied format on import, this change +has no impact on its use for pre-multiplied arithmetic, meaning that +superluminous colors are still supported, it also opens up to GEGL more widely +expect premultiplied data in more operations which will become a speedup when +more filters want to integrate in the layer processing pipeline.

+ +

There is a post on patreon with further details about details of the implementation.

-- 2.30.2